import QtQuick 1.0
import "Article.js" as ArticleUtil
 Item {
     id: delegate
     width: modulepiclist_page.menuWidth / allCount; height: 51

     property string firstImageUp: "../images/articles/btn_1_up.png";
     property string footImageUp: "../images/articles/btn_3_up.png";
     property string otherImageUp: "../images/articles/btn_2_up.png";
     property string firstImageDown: "../images/articles/btn_1_down.png";
     property string footImageDown: "../images/articles/btn_3_down.png";
     property string otherImageDown: "../images/articles/btn_2_down.png";
     property int allCount: 4;

     Image{
       anchors.fill: parent
       source: delegate.ListView.isCurrentItem ?(index===0 ? firstImageDown:(index==(allCount-1)?footImageDown :otherImageDown)):(index===0 ?firstImageUp:(index==(allCount-1) ? footImageUp:otherImageUp))
     }

     Text {
         text: typeName
         color: delegate.ListView.isCurrentItem ? "white" : "black"
         font { family: "Helvetica"; pointSize: 16; bold: true }
         anchors {
             verticalCenter: parent.verticalCenter
             horizontalCenter:parent.horizontalCenter
         }
     }

     MouseArea {
         anchors.fill: delegate
         onClicked: {
             delegate.ListView.view.currentIndex = index
             modulepiclist_page.currentPage = 1;
             modulepiclist_page.imgType = typeId
             modulepiclist_page.getModulepiclistData(1);
         }
     }
 }
